<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>{{message}}</h1>
        <hr />
        <h2>{{str}}</h2>
        <hr />
        <h3>年龄：{{age?"29":"30"}}</h3>
    </div>

    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                message: "你好",
                str: "会好起来的",
                age: true,
                obj: {
                    age: 29,
                },
            },
        });
        setTimeout(() => {
            console.log("执行");
            vm.obj.age = 30;
            vm.age = false;
        }, 5000);
        vm.str = "haha";
        vm.message = "会过去的！";
    </script>
</body>

</html>